﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
<title></title>
<link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="css/main.css" />
	<link rel="stylesheet" href="css/main2.css" />
	<link rel="stylesheet" href="css/font_eolqem241z66flxr.css" />
</head>

<body>
<div class="childrenBody">
	<div class="panel_box row row-header">
		<div class="panel col">
			<!--<a href="javascript:;" data-url="page/message/message.html">-->
				<!--<div class="panel_icon" >-->
					<!--<i class="iconfont icon-kehuzongshu"></i>-->
				<!--</div>-->
				<div class="panel_word userAll">
					<em>客户总数</em>
					<span id="totalMemberCount" class="number-main" style="color:#5785db;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayMemberCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthMemberCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayMemberCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthMemberCount"></span></span>-->
				</div>
			</a>
		</div>
		<div class="panel col">
			<!--<a href="javascript:;" data-url="page/user/allUsers.html">-->
				<!--<div class="panel_icon" style="background-color:#FF5722;" >-->
					<!--<i class="iconfont icon-baodanbanli"></i>-->
				<!--</div>-->
				<div class="panel_word userAll">
					<em>保单办理</em>
					<span id="totalPolicyCount" class="number-main" style="color:#f84956;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayPolicyCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthPolicyCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayPolicyCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthPolicyCount"></span></span>-->
				</div>
			<!--</a>-->
		</div>
		<div class="panel col">
			<!--<a href="javascript:;" data-url="page/user/allUsers.html">-->
				<!--<div class="panel_icon" style="background-color:#009688;">-->
					<!--<i class="iconfont icon-qiaquanhexiao"></i>-->
				<!--</div>-->
				<div class="panel_word userAll">
					<em>卡券核销</em>
					<span id="totalCardVerifyCount" class="number-main" style="color:#ff6700;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayCardVerifyCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthCardVerifyCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayCardVerifyCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthCardVerifyCount"></span></span>-->
				</div>
			<!--</a>-->
		</div>

		<div class="panel col">
			<!--<a href="javascript:;" data-url="page/img/images.html">-->
				<!--<div class="panel_icon" style="background-color:#5FB878;">-->
					<!--<i class="iconfont icon-qiaquanjine"></i>-->
				<!--</div>-->
				<div class="panel_word imgAll">
					<em>卡券金额</em>
					<span id="totalCardMoneyCount" class="number-main" style="color:#1bc8ac;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayCardMoneyCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthCardMoneyCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayCardMoneyCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthCardMoneyCount"></span></span>-->
				</div>
			<!--</a>-->
		</div>
		<div class="panel col">
			<!--<a href="javascript:;" data-url="page/news/newsList.html">-->
				<!--<div class="panel_icon" style="background-color:#F7B824;">-->
					<!--<i class="iconfont icon-gongdanjiesuan"></i>-->
				<!--</div>-->
				<div class="panel_word waitNews">
					<em>工单结算</em>
					<span id="totalOrderCount" class="number-main" style="color:#f5b53a;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayOrderCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthOrderCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayOrderCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthOrderCount"></span></span>-->
				</div>
			<!--</a>-->
		</div>
		<div class="panel col max_panel">
			<!--<a href="javascript:;" data-url="page/news/newsList.html">-->
				<!--<div class="panel_icon" style="background-color:#2F4056;">-->
					<!--<i class="iconfont icon-gongdanjine"></i>-->
				<!--</div>-->
				<div class="panel_word allNews">
					<em>工单金额</em>
					<span id="totalOrderMoneyCount" class="number-main" style="color:#cd87d9;"></span>
					<div class="main-footer">
						<p class="add">今日新增</p><p id="todayOrderMoneyCount" class="add-number"></p>
						<p class="add">本月新增</p><p id="thisMonthOrderMoneyCount" class="add-number"></p>
					</div>
					<!--<span style="font-size: 10px;">今日新增&nbsp;<span id="todayOrderMoneyCount"></span>&nbsp;|&nbsp;本月新增&nbsp;<span id="thisMonthOrderMoneyCount"></span></span>-->
				</div>
			<!--</a>-->
		</div>
	</div>

	<div class="row">
		<div class="sysNotice col">
			<blockquote class="layui-elem-quote title">店铺营收 默认显示本年的统计数据</blockquote>
			<div class="layui-elem-quote layui-quote-nm">
				<div id="main" style="width:1500px;height:380px;margin:85px 60px 0 60px;">
				</div>
			</div>
		</div>
	</div>
	</div>

</div>


</body>
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/echarts/echarts.common.min.js"></script>


<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '单位:元'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['卡券金额','工单金额']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
       		data:[]
        },
        yAxis: {
            type: 'value'
        }
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);


</script>
<script type="text/javascript">
    var categoryList;
    var monthsInCurrentYears;
    $.ajax({
        type : "GET",
        url : 'statistics/get',
        dataType : 'json',
        async : false,
        success : function(data) {
            console.log(data);
            var dto=data.data;
           // var obj = eval('(' + dto + ')');

            //$("#loginUser").text(dto.loginUser);

            $("#todayMemberCount").text(dto.memberStat["today"]);
            $("#thisMonthMemberCount").text(dto.memberStat["thisMonth"]);
            $("#totalMemberCount").text(dto.memberStat["total"]);

            $("#todayPolicyCount").text(dto.policyStat["today"]);
            $("#thisMonthPolicyCount").text(dto.policyStat["thisMonth"]);
            $("#totalPolicyCount").text(dto.policyStat["total"]);

            $("#todayCardVerifyCount").text(dto.cardVerifyStat["today"]);
            $("#thisMonthCardVerifyCount").text(dto.cardVerifyStat["thisMonth"]);
            $("#totalCardVerifyCount").text(dto.cardVerifyStat["total"]);

            $("#todayCardMoneyCount").text(dto.cardMoneyStat["today"]);
            $("#thisMonthCardMoneyCount").text(dto.cardMoneyStat["thisMonth"]);
            $("#totalCardMoneyCount").text(dto.cardMoneyStat["total"]);

            $("#todayOrderCount").text(dto.orderStat["today"]);
            $("#thisMonthOrderCount").text(dto.orderStat["thisMonth"]);
            $("#totalOrderCount").text(dto.orderStat["total"]);

            $("#todayOrderMoneyCount").text(dto.orderMoneyStat["today"]);
            $("#thisMonthOrderMoneyCount").text(dto.orderMoneyStat["thisMonth"]);
            $("#totalOrderMoneyCount").text(dto.orderMoneyStat["total"]);
            monthsInCurrentYears=dto.monthsInCurrentYear;
            myChart.setOption({
                xAxis: {
                    data:dto.monthsInCurrentYear
                },
                series: [
                    {
                        name:'卡券金额',
                        type:'line',
                        stack: '总量',
                        data:dto.cardMoneyGroupByMonth
                    },
                    {
                        name:'工单金额',
                        type:'line',
                        stack: '总量',
                        data:dto.orderMoneyGroupByMonth
                    },
                ]
            });
        }
    });

    //数字格式化
    $(".panel span").each(function(){
        $(this).html($(this).text()>9999 ? ($(this).text()/10000).toFixed(2) + "<em>万</em>" : $(this).text());
    })
</script>
</html>